//
//  EPMAccount.m
//  WeiBoByOC
//
//  Created by 马继鵬 on 17/3/25.
//  Copyright © 2017年 7TH. All rights reserved.
//

#import "EPMAccount.h"

@interface EPMAccount () 

@end

@implementation EPMAccount

    
    
    - (void)setExpires_in:(CGFloat)expires_in
    {
        _expires_in = expires_in;
         _expires_date = [NSDate dateWithTimeIntervalSinceNow:expires_in];
    }
   
    
    - (void)encodeWithCoder:(NSCoder *)aCoder
    {
        [aCoder encodeObject:_expires_date forKey:@"expires_date"];
        [aCoder encodeObject:_access_token forKey:@"access_token"];
        [aCoder encodeObject:_uid forKey:@"uid"];
        [aCoder encodeObject:_name forKey:@"name"];
        [aCoder encodeObject:_avatar_large forKey:@"avatar_large"];
        
       
    }
    - (instancetype)initWithCoder:(NSCoder *)aDecoder
    {
        if (self = [super init]){
        self.access_token = [aDecoder decodeObjectForKey:@"access_token"];
        self.expires_date = [aDecoder decodeObjectForKey:@"expires_date"];
        self.uid = [aDecoder decodeObjectForKey:@"uid"];
        self.name = [aDecoder decodeObjectForKey:@"name"];
        self.avatar_large = [aDecoder decodeObjectForKey:@"avatar_large"];
          
        }
        return self;
    }
    
    -(void)setValue:(id)value forUndefinedKey:(NSString *)key{
        
    }
   
    
@end



//@property (copy,nonatomic) NSString* access_token;
//@property (assign,nonatomic) CGFloat expires_in;
//@property (strong,nonatomic) NSDate* expires_date;
//@property (copy,nonatomic) NSString* uid;
//@property (copy,nonatomic) NSString* name;
//@property (copy,nonatomic) NSString* avatar_large;
